

//@flow
import { VersionState } from "./version.state";
import * as ActionType from "./version.type";
import { state as InitState } from "./version.state";
export function versionReducer(state:VersionState=InitState,action){
    switch(action.type){
        case ActionType.SETUP_CHECKING:
        case ActionType.UPDATE_PROGRESS:
        case ActionType.UPDATE_META_INFO:
        case ActionType.UPDATE_PACKAGE_INFO:
        case ActionType.UPDATE_STATUS:
            return {
                ...state,
                ...action
            }
        default :
            return {...state} ;
    }
}